var ur = Object.defineProperty
  , hr = Object.defineProperties;
var dr = Object.getOwnPropertyDescriptors;
var ht = Object.getOwnPropertySymbols;
var pr = Object.prototype.hasOwnProperty
  , vr = Object.prototype.propertyIsEnumerable;
var dt = Math.pow
  , Re = (r, e, t) => e in r ? ur(r, e, {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: t
}) : r[e] = t
  , Be = (r, e) => {
    for (var t in e || (e = {}))
        pr.call(e, t) && Re(r, t, e[t]);
    if (ht)
        for (var t of ht(e))
            vr.call(e, t) && Re(r, t, e[t]);
    return r
}
  , De = (r, e) => hr(r, dr(e));
var X = (r, e, t) => (Re(r, typeof e != "symbol" ? e + "" : e, t),
t);
var E = (r, e, t) => new Promise( (a, n) => {
    var o = v => {
        try {
            d(t.next(v))
        } catch (b) {
            n(b)
        }
    }
      , c = v => {
        try {
            d(t.throw(v))
        } catch (b) {
            n(b)
        }
    }
      , d = v => v.done ? a(v.value) : Promise.resolve(v.value).then(o, c);
    d((t = t.apply(r, e)).next())
}
);
import {a as yr, q as br, t as gr, p as Me, G as wr, _ as mr, I as Sr, f as V, J as _r, H as Ar, r as D, w as he, D as Et, K as xr, d as Tr, u as Or, s as Pr, x as Lr, e as Er, b as Ir, o as te, c as oe, g as ce, h as ye, i as U, L as pt, l as $, j as jr, M as kr, N as vt, z as Cr, A as yt, F as Ne, B as bt, y as se, C as Rr, n as be, O as Br} from "./index-bb356d8c.js";
import {A as Dr, _ as Mr, a as Nr} from "./BarPicked.vue_vue_type_script_setup_true_lang-37463088.js";
import {H as ge, S as Ur, _ as $r, s as we} from "./BarPrice.vue_vue_type_script_setup_true_lang-3970d874.js";
import "./_plugin-vue_export-helper-c27b6911.js";
const gt = "/assets/check_circle-d3183b5c.svg";
var Ye = function(r, e) {
    return Ye = Object.setPrototypeOf || {
        __proto__: []
    }instanceof Array && function(t, a) {
        t.__proto__ = a
    }
    || function(t, a) {
        for (var n in a)
            Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n])
    }
    ,
    Ye(r, e)
};
function It(r, e) {
    if (typeof e != "function" && e !== null)
        throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
    Ye(r, e);
    function t() {
        this.constructor = r
    }
    r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype,
    new t)
}
function wt(r) {
    var e = typeof Symbol == "function" && Symbol.iterator
      , t = e && r[e]
      , a = 0;
    if (t)
        return t.call(r);
    if (r && typeof r.length == "number")
        return {
            next: function() {
                return r && a >= r.length && (r = void 0),
                {
                    value: r && r[a++],
                    done: !r
                }
            }
        };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
}
function Ae(r, e) {
    var t = typeof Symbol == "function" && r[Symbol.iterator];
    if (!t)
        return r;
    var a = t.call(r), n, o = [], c;
    try {
        for (; (e === void 0 || e-- > 0) && !(n = a.next()).done; )
            o.push(n.value)
    } catch (d) {
        c = {
            error: d
        }
    } finally {
        try {
            n && !n.done && (t = a.return) && t.call(a)
        } finally {
            if (c)
                throw c.error
        }
    }
    return o
}
function xe(r, e, t) {
    if (t || arguments.length === 2)
        for (var a = 0, n = e.length, o; a < n; a++)
            (o || !(a in e)) && (o || (o = Array.prototype.slice.call(e, 0, a)),
            o[a] = e[a]);
    return r.concat(o || Array.prototype.slice.call(e))
}
function z(r) {
    return typeof r == "function"
}
function Vr(r) {
    var e = function(a) {
        Error.call(a),
        a.stack = new Error().stack
    }
      , t = r(e);
    return t.prototype = Object.create(Error.prototype),
    t.prototype.constructor = t,
    t
}
var Ue = Vr(function(r) {
    return function(t) {
        r(this),
        this.message = t ? t.length + ` errors occurred during unsubscription:
` + t.map(function(a, n) {
            return n + 1 + ") " + a.toString()
        }).join(`
  `) : "",
        this.name = "UnsubscriptionError",
        this.errors = t
    }
});
function mt(r, e) {
    if (r) {
        var t = r.indexOf(e);
        0 <= t && r.splice(t, 1)
    }
}
var Xe = function() {
    function r(e) {
        this.initialTeardown = e,
        this.closed = !1,
        this._parentage = null,
        this._finalizers = null
    }
    return r.prototype.unsubscribe = function() {
        var e, t, a, n, o;
        if (!this.closed) {
            this.closed = !0;
            var c = this._parentage;
            if (c)
                if (this._parentage = null,
                Array.isArray(c))
                    try {
                        for (var d = wt(c), v = d.next(); !v.done; v = d.next()) {
                            var b = v.value;
                            b.remove(this)
                        }
                    } catch (L) {
                        e = {
                            error: L
                        }
                    } finally {
                        try {
                            v && !v.done && (t = d.return) && t.call(d)
                        } finally {
                            if (e)
                                throw e.error
                        }
                    }
                else
                    c.remove(this);
            var m = this.initialTeardown;
            if (z(m))
                try {
                    m()
                } catch (L) {
                    o = L instanceof Ue ? L.errors : [L]
                }
            var w = this._finalizers;
            if (w) {
                this._finalizers = null;
                try {
                    for (var O = wt(w), S = O.next(); !S.done; S = O.next()) {
                        var F = S.value;
                        try {
                            St(F)
                        } catch (L) {
                            o = o != null ? o : [],
                            L instanceof Ue ? o = xe(xe([], Ae(o)), Ae(L.errors)) : o.push(L)
                        }
                    }
                } catch (L) {
                    a = {
                        error: L
                    }
                } finally {
                    try {
                        S && !S.done && (n = O.return) && n.call(O)
                    } finally {
                        if (a)
                            throw a.error
                    }
                }
            }
            if (o)
                throw new Ue(o)
        }
    }
    ,
    r.prototype.add = function(e) {
        var t;
        if (e && e !== this)
            if (this.closed)
                St(e);
            else {
                if (e instanceof r) {
                    if (e.closed || e._hasParent(this))
                        return;
                    e._addParent(this)
                }
                (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e)
            }
    }
    ,
    r.prototype._hasParent = function(e) {
        var t = this._parentage;
        return t === e || Array.isArray(t) && t.includes(e)
    }
    ,
    r.prototype._addParent = function(e) {
        var t = this._parentage;
        this._parentage = Array.isArray(t) ? (t.push(e),
        t) : t ? [t, e] : e
    }
    ,
    r.prototype._removeParent = function(e) {
        var t = this._parentage;
        t === e ? this._parentage = null : Array.isArray(t) && mt(t, e)
    }
    ,
    r.prototype.remove = function(e) {
        var t = this._finalizers;
        t && mt(t, e),
        e instanceof r && e._removeParent(this)
    }
    ,
    r.EMPTY = function() {
        var e = new r;
        return e.closed = !0,
        e
    }(),
    r
}();
Xe.EMPTY;
function jt(r) {
    return r instanceof Xe || r && "closed"in r && z(r.remove) && z(r.add) && z(r.unsubscribe)
}
function St(r) {
    z(r) ? r() : r.unsubscribe()
}
var kt = {
    onUnhandledError: null,
    onStoppedNotification: null,
    Promise: void 0,
    useDeprecatedSynchronousErrorHandling: !1,
    useDeprecatedNextContext: !1
}
  , We = {
    setTimeout: function(r, e) {
        for (var t = [], a = 2; a < arguments.length; a++)
            t[a - 2] = arguments[a];
        var n = We.delegate;
        return n != null && n.setTimeout ? n.setTimeout.apply(n, xe([r, e], Ae(t))) : setTimeout.apply(void 0, xe([r, e], Ae(t)))
    },
    clearTimeout: function(r) {
        var e = We.delegate;
        return ((e == null ? void 0 : e.clearTimeout) || clearTimeout)(r)
    },
    delegate: void 0
};
function Fr(r) {
    We.setTimeout(function() {
        throw r
    })
}
function _t() {}
function Hr(r) {
    r()
}
var Ct = function(r) {
    It(e, r);
    function e(t) {
        var a = r.call(this) || this;
        return a.isStopped = !1,
        t ? (a.destination = t,
        jt(t) && t.add(a)) : a.destination = Xr,
        a
    }
    return e.create = function(t, a, n) {
        return new qe(t,a,n)
    }
    ,
    e.prototype.next = function(t) {
        this.isStopped || this._next(t)
    }
    ,
    e.prototype.error = function(t) {
        this.isStopped || (this.isStopped = !0,
        this._error(t))
    }
    ,
    e.prototype.complete = function() {
        this.isStopped || (this.isStopped = !0,
        this._complete())
    }
    ,
    e.prototype.unsubscribe = function() {
        this.closed || (this.isStopped = !0,
        r.prototype.unsubscribe.call(this),
        this.destination = null)
    }
    ,
    e.prototype._next = function(t) {
        this.destination.next(t)
    }
    ,
    e.prototype._error = function(t) {
        try {
            this.destination.error(t)
        } finally {
            this.unsubscribe()
        }
    }
    ,
    e.prototype._complete = function() {
        try {
            this.destination.complete()
        } finally {
            this.unsubscribe()
        }
    }
    ,
    e
}(Xe)
  , Yr = Function.prototype.bind;
function $e(r, e) {
    return Yr.call(r, e)
}
var Wr = function() {
    function r(e) {
        this.partialObserver = e
    }
    return r.prototype.next = function(e) {
        var t = this.partialObserver;
        if (t.next)
            try {
                t.next(e)
            } catch (a) {
                me(a)
            }
    }
    ,
    r.prototype.error = function(e) {
        var t = this.partialObserver;
        if (t.error)
            try {
                t.error(e)
            } catch (a) {
                me(a)
            }
        else
            me(e)
    }
    ,
    r.prototype.complete = function() {
        var e = this.partialObserver;
        if (e.complete)
            try {
                e.complete()
            } catch (t) {
                me(t)
            }
    }
    ,
    r
}()
  , qe = function(r) {
    It(e, r);
    function e(t, a, n) {
        var o = r.call(this) || this, c;
        if (z(t) || !t)
            c = {
                next: t != null ? t : void 0,
                error: a != null ? a : void 0,
                complete: n != null ? n : void 0
            };
        else {
            var d;
            o && kt.useDeprecatedNextContext ? (d = Object.create(t),
            d.unsubscribe = function() {
                return o.unsubscribe()
            }
            ,
            c = {
                next: t.next && $e(t.next, d),
                error: t.error && $e(t.error, d),
                complete: t.complete && $e(t.complete, d)
            }) : c = t
        }
        return o.destination = new Wr(c),
        o
    }
    return e
}(Ct);
function me(r) {
    Fr(r)
}
function qr(r) {
    throw r
}
var Xr = {
    closed: !0,
    next: _t,
    error: qr,
    complete: _t
}
  , zr = function() {
    return typeof Symbol == "function" && Symbol.observable || "@@observable"
}();
function Jr(r) {
    return r
}
function Qr(r) {
    return r.length === 0 ? Jr : r.length === 1 ? r[0] : function(t) {
        return r.reduce(function(a, n) {
            return n(a)
        }, t)
    }
}
var Zr = function() {
    function r(e) {
        e && (this._subscribe = e)
    }
    return r.prototype.lift = function(e) {
        var t = new r;
        return t.source = this,
        t.operator = e,
        t
    }
    ,
    r.prototype.subscribe = function(e, t, a) {
        var n = this
          , o = Gr(e) ? e : new qe(e,t,a);
        return Hr(function() {
            var c = n
              , d = c.operator
              , v = c.source;
            o.add(d ? d.call(o, v) : v ? n._subscribe(o) : n._trySubscribe(o))
        }),
        o
    }
    ,
    r.prototype._trySubscribe = function(e) {
        try {
            return this._subscribe(e)
        } catch (t) {
            e.error(t)
        }
    }
    ,
    r.prototype.forEach = function(e, t) {
        var a = this;
        return t = At(t),
        new t(function(n, o) {
            var c = new qe({
                next: function(d) {
                    try {
                        e(d)
                    } catch (v) {
                        o(v),
                        c.unsubscribe()
                    }
                },
                error: o,
                complete: n
            });
            a.subscribe(c)
        }
        )
    }
    ,
    r.prototype._subscribe = function(e) {
        var t;
        return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e)
    }
    ,
    r.prototype[zr] = function() {
        return this
    }
    ,
    r.prototype.pipe = function() {
        for (var e = [], t = 0; t < arguments.length; t++)
            e[t] = arguments[t];
        return Qr(e)(this)
    }
    ,
    r.prototype.toPromise = function(e) {
        var t = this;
        return e = At(e),
        new e(function(a, n) {
            var o;
            t.subscribe(function(c) {
                return o = c
            }, function(c) {
                return n(c)
            }, function() {
                return a(o)
            })
        }
        )
    }
    ,
    r.create = function(e) {
        return new r(e)
    }
    ,
    r
}();
function At(r) {
    var e;
    return (e = r != null ? r : kt.Promise) !== null && e !== void 0 ? e : Promise
}
function Kr(r) {
    return r && z(r.next) && z(r.error) && z(r.complete)
}
function Gr(r) {
    return r && r instanceof Ct || Kr(r) && jt(r)
}
var ze = {}
  , Rt = {}
  , ea = [0, 255, 65535, 16777215, 4294967295];
function ta(r, e, t, a, n) {
    var o;
    for (o = 0; o < n; o++)
        t[a + o] = r[e + o]
}
function ra(r, e, t, a) {
    var n;
    for (n = 0; n < a; n++)
        r[e + n] = r[e - t + n]
}
function Je(r) {
    this.array = r,
    this.pos = 0
}
Je.prototype.readUncompressedLength = function() {
    for (var r = 0, e = 0, t, a; e < 32 && this.pos < this.array.length; ) {
        if (t = this.array[this.pos],
        this.pos += 1,
        a = t & 127,
        a << e >>> e !== a)
            return -1;
        if (r |= a << e,
        t < 128)
            return r;
        e += 7
    }
    return -1
}
;
Je.prototype.uncompressToBuffer = function(r) {
    for (var e = this.array, t = e.length, a = this.pos, n = 0, o, c, d, v; a < e.length; )
        if (o = e[a],
        a += 1,
        o & 3) {
            switch (o & 3) {
            case 1:
                c = (o >>> 2 & 7) + 4,
                v = e[a] + (o >>> 5 << 8),
                a += 1;
                break;
            case 2:
                if (a + 1 >= t)
                    return !1;
                c = (o >>> 2) + 1,
                v = e[a] + (e[a + 1] << 8),
                a += 2;
                break;
            case 3:
                if (a + 3 >= t)
                    return !1;
                c = (o >>> 2) + 1,
                v = e[a] + (e[a + 1] << 8) + (e[a + 2] << 16) + (e[a + 3] << 24),
                a += 4;
                break
            }
            if (v === 0 || v > n)
                return !1;
            ra(r, n, v, c),
            n += c
        } else {
            if (c = (o >>> 2) + 1,
            c > 60) {
                if (a + 3 >= t)
                    return !1;
                d = c - 60,
                c = e[a] + (e[a + 1] << 8) + (e[a + 2] << 16) + (e[a + 3] << 24),
                c = (c & ea[d]) + 1,
                a += d
            }
            if (a + c > t)
                return !1;
            ta(e, a, r, n, c),
            a += c,
            n += c
        }
    return !0
}
;
Rt.SnappyDecompressor = Je;
var Bt = {}
  , aa = 16
  , na = 1 << aa
  , Dt = 14
  , Ve = new Array(Dt + 1);
function fe(r, e) {
    return r * 506832829 >>> e
}
function ue(r, e) {
    return r[e] + (r[e + 1] << 8) + (r[e + 2] << 16) + (r[e + 3] << 24)
}
function xt(r, e, t) {
    return r[e] === r[t] && r[e + 1] === r[t + 1] && r[e + 2] === r[t + 2] && r[e + 3] === r[t + 3]
}
function oa(r, e, t, a, n) {
    var o;
    for (o = 0; o < n; o++)
        t[a + o] = r[e + o]
}
function Tt(r, e, t, a, n) {
    return t <= 60 ? (a[n] = t - 1 << 2,
    n += 1) : t < 256 ? (a[n] = 240,
    a[n + 1] = t - 1,
    n += 2) : (a[n] = 244,
    a[n + 1] = t - 1 & 255,
    a[n + 2] = t - 1 >>> 8,
    n += 3),
    oa(r, e, a, n, t),
    n + t
}
function Fe(r, e, t, a) {
    return a < 12 && t < 2048 ? (r[e] = 1 + (a - 4 << 2) + (t >>> 8 << 5),
    r[e + 1] = t & 255,
    e + 2) : (r[e] = 2 + (a - 1 << 2),
    r[e + 1] = t & 255,
    r[e + 2] = t >>> 8,
    e + 3)
}
function sa(r, e, t, a) {
    for (; a >= 68; )
        e = Fe(r, e, t, 64),
        a -= 64;
    return a > 64 && (e = Fe(r, e, t, 60),
    a -= 60),
    Fe(r, e, t, a)
}
function ia(r, e, t, a, n) {
    for (var o = 1; 1 << o <= t && o <= Dt; )
        o += 1;
    o -= 1;
    var c = 32 - o;
    typeof Ve[o] == "undefined" && (Ve[o] = new Uint16Array(1 << o));
    var d = Ve[o], v;
    for (v = 0; v < d.length; v++)
        d[v] = 0;
    var b = e + t, m, w = e, O = e, S, F, L, q, ie, H, re, I, R, J, Q, ee = !0, Z = 15;
    if (t >= Z)
        for (m = b - Z,
        e += 1,
        F = fe(ue(r, e), c); ee; ) {
            ie = 32,
            L = e;
            do {
                if (e = L,
                S = F,
                H = ie >>> 5,
                ie += 1,
                L = e + H,
                e > m) {
                    ee = !1;
                    break
                }
                F = fe(ue(r, L), c),
                q = w + d[S],
                d[S] = e - w
            } while (!xt(r, e, q));
            if (!ee)
                break;
            n = Tt(r, O, e - O, a, n);
            do {
                for (re = e,
                I = 4; e + I < b && r[e + I] === r[q + I]; )
                    I += 1;
                if (e += I,
                R = re - q,
                n = sa(a, n, R, I),
                O = e,
                e >= m) {
                    ee = !1;
                    break
                }
                J = fe(ue(r, e - 1), c),
                d[J] = e - 1 - w,
                Q = fe(ue(r, e), c),
                q = w + d[Q],
                d[Q] = e - w
            } while (xt(r, e, q));
            if (!ee)
                break;
            e += 1,
            F = fe(ue(r, e), c)
        }
    return O < b && (n = Tt(r, O, b - O, a, n)),
    n
}
function la(r, e, t) {
    do
        e[t] = r & 127,
        r = r >>> 7,
        r > 0 && (e[t] += 128),
        t += 1;
    while (r > 0);
    return t
}
function Qe(r) {
    this.array = r
}
Qe.prototype.maxCompressedLength = function() {
    var r = this.array.length;
    return 32 + r + Math.floor(r / 6)
}
;
Qe.prototype.compressToBuffer = function(r) {
    var e = this.array, t = e.length, a = 0, n = 0, o;
    for (n = la(t, r, n); a < t; )
        o = Math.min(t - a, na),
        n = ia(e, a, o, r, n),
        a += o;
    return n
}
;
Bt.SnappyCompressor = Qe;
function Mt() {
    return typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node != "undefined"
}
function Te(r) {
    return r instanceof Uint8Array && (!Mt() || !Buffer.isBuffer(r))
}
function Oe(r) {
    return r instanceof ArrayBuffer
}
function Nt(r) {
    return Mt() ? Buffer.isBuffer(r) : !1
}
var ca = Rt.SnappyDecompressor
  , fa = Bt.SnappyCompressor
  , Ut = "Argument compressed must be type of ArrayBuffer, Buffer, or Uint8Array";
function ua(r, e) {
    if (!Te(r) && !Oe(r) && !Nt(r))
        throw new TypeError(Ut);
    var t = !1
      , a = !1;
    Te(r) ? t = !0 : Oe(r) && (a = !0,
    r = new Uint8Array(r));
    var n = new ca(r)
      , o = n.readUncompressedLength();
    if (o === -1)
        throw new Error("Invalid Snappy bitstream");
    if (o > e)
        throw new Error(`The uncompressed length of ${o} is too big, expect at most ${e}`);
    var c, d;
    if (t) {
        if (c = new Uint8Array(o),
        !n.uncompressToBuffer(c))
            throw new Error("Invalid Snappy bitstream")
    } else if (a) {
        if (c = new ArrayBuffer(o),
        d = new Uint8Array(c),
        !n.uncompressToBuffer(d))
            throw new Error("Invalid Snappy bitstream")
    } else if (c = Buffer.alloc(o),
    !n.uncompressToBuffer(c))
        throw new Error("Invalid Snappy bitstream");
    return c
}
function ha(r) {
    if (!Te(r) && !Oe(r) && !Nt(r))
        throw new TypeError(Ut);
    var e = !1
      , t = !1;
    Te(r) ? e = !0 : Oe(r) && (t = !0,
    r = new Uint8Array(r));
    var a = new fa(r), n = a.maxCompressedLength(), o, c, d;
    if (e ? (o = new Uint8Array(n),
    d = a.compressToBuffer(o)) : t ? (o = new ArrayBuffer(n),
    c = new Uint8Array(o),
    d = a.compressToBuffer(c)) : (o = Buffer.alloc(n),
    d = a.compressToBuffer(o)),
    !o.slice) {
        var v = new Uint8Array(Array.prototype.slice.call(o, 0, d));
        if (e)
            return v;
        if (t)
            return v.buffer;
        throw new Error("Not implemented")
    }
    return o.slice(0, d)
}
ze.uncompress = ua;
ze.compress = ha;
const Se = "seatType"
  , $t = "areaType"
  , Ot = "seatCheck"
  , Pt = "background"
  , Lt = "backgroundImage"
  , da = 4
  , pa = +"0.6"
  , va = +"40"
  , ya = +"22"
  , ba = _r();
class ga {
    constructor(e) {
        X(this, "_seats");
        X(this, "_seatsAvail");
        X(this, "_sid");
        X(this, "seatIconList", null);
        X(this, "areaSeatTempt", "");
        X(this, "areaObj", yr({}));
        X(this, "isLoadedArea", !1);
        X(this, "areaResolveQueue", new Map);
        this._seats = Object.create(null),
        this._seatsAvail = Object.create(null),
        this._sid = e
    }
    fetchAreaData(e) {
        return E(this, null, function*() {
            return this.isLoadedArea ? e ? this.areaObj[e] || null : this.areaObj : e && this.areaObj[e] ? this.areaObj[e] : new Promise(t => {
                this.areaResolveQueue.set(e || "", t)
            }
            )
        })
    }
    setAreaSeatTempt(e) {
        this.areaSeatTempt = e
    }
    createAreaDataFlow(e) {
        const t = br(e, da);
        let a = t.length;
        for (const n of t)
            setTimeout( () => E(this, null, function*() {
                const {data: o} = yield gr(this._sid, n).catch( () => ({
                    data: null
                }));
                if (o)
                    for (const c of o)
                        this.areaObj[c.k] = c;
                a--,
                a === 0 && (this.isLoadedArea = !0);
                for (const c of this.areaResolveQueue)
                    this.isLoadedArea ? (c[1](c[0] ? this.areaObj[c[0]] : this.areaObj),
                    this.areaResolveQueue.delete(c[0])) : c[0] && this.areaObj[c[0]] && (c[1](this.areaObj[c[0]]),
                    this.areaResolveQueue.delete(c[0]))
            }), 0)
    }
    fetchSeatData(e) {
        return E(this, null, function*() {
            if (!this.areaSeatTempt)
                return [];
            const t = `${this.areaSeatTempt.replace("$a", e)}?t=${Date.now()}`
              , {n: a} = yield Me(t);
            return a.map(n => {
                const o = n.g.split(",").map(c => +c);
                return {
                    coords: [o[0], o[1]],
                    coordsStr: n.g,
                    icon: n.icon,
                    angle: n.angle,
                    aid: e,
                    x: n.x ? +n.x : void 0,
                    y: n.y ? +n.y : void 0
                }
            }
            )
        })
    }
    fetchAvailSeatData2(e) {
        return new Promise( (t, a) => {
            wr({
                areaId: e,
                showId: this._sid
            }).then(n => {
                mr( () => import("./onlineShowSeat_pb-0fd8076d.js"), ["assets/onlineShowSeat_pb-0fd8076d.js", "assets/index-bb356d8c.js", "assets/index-093d4d8c.css"]).then(o => {
                    const d = o.default.ShowAreaPb.deserializeBinary(n).toObject()
                      , v = d.ai.map(b => {
                        const m = b.g.split(",").map(w => +w);
                        return {
                            coords: [m[0], m[1]],
                            coordsStr: b.g,
                            aid: e,
                            color: b.e,
                            fareLevel: b.ai,
                            id: b.k,
                            rowName: b.i,
                            name: b.b,
                            areaName: d.a,
                            x: b.x ? +b.x : void 0,
                            y: b.y ? +b.y : void 0
                        }
                    }
                    );
                    t(v)
                }
                )
            }
            ).catch(n => {
                a(n)
            }
            )
        }
        )
    }
    fetchAvailSeatData(e) {
        return new Promise( (t, a) => {
            Sr({
                areaId: e,
                showId: this._sid
            }).then(n => {
                var O;
                const c = new Uint8Array(n).map(S => S ^ ya)
                  , d = new TextDecoder
                  , v = ze.uncompress(c)
                  , b = d.decode(v)
                  , m = JSON.parse(b)
                  , w = (O = m.ai) == null ? void 0 : O.map(S => {
                    const F = S.g.split(",").map(L => +L);
                    return {
                        coords: [F[0], F[1]],
                        coordsStr: S.g,
                        aid: e,
                        color: S.e,
                        fareLevel: S.ai,
                        id: S.k,
                        rowName: S.i,
                        name: S.b,
                        areaName: m.a,
                        x: S.x ? +S.x : void 0,
                        y: S.y ? +S.y : void 0
                    }
                }
                );
                t(w || [])
            }
            ).catch(n => {
                a(n)
            }
            )
        }
        )
    }
    getMultiSeatFlow(e) {
        const t = this;
        return setTimeout( () => {
            this.manageSeatCache(e)
        }
        , 0),
        new Zr(a => {
            e.forEach(n => E(this, null, function*() {
                t._seatsAvail[n] === void 0 ? (t._seatsAvail[n] = null,
                t.fetchAvailSeatData(n).then(o => {
                    t._seatsAvail[n] = o,
                    a.next(t._seatsAvail[n])
                }
                ).catch( () => {
                    delete t._seatsAvail[n]
                }
                )) : t._seatsAvail[n] && a.next(t._seatsAvail[n]),
                setTimeout( () => {
                    t._seats[n] === void 0 ? (t._seats[n] = null,
                    t.fetchSeatData(n).then(o => {
                        t._seats[n] = o,
                        a.next(t._seats[n])
                    }
                    ).catch( () => {
                        delete t._seats[n]
                    }
                    )) : t._seats[n] && a.next(t._seats[n])
                }
                , 0)
            }))
        }
        )
    }
    getSeatListOfArea(e) {
        return this._seats[e]
    }
    getSeatIconList() {
        return E(this, null, function*() {
            if (!this.seatIconList) {
                const e = yield Me("https://res.dasheng.top/global/seat/seat_icon.json?t=" + Date.now());
                this.seatIconList = e
            }
            return this.seatIconList
        })
    }
    getSeatIcon(e=0) {
        return E(this, null, function*() {
            try {
                const a = (yield this.getSeatIconList()).find(n => n.id === e);
                if (a)
                    return yield ba(a.svg);
                throw "没有找到这个iconId"
            } catch (t) {
                return this.getDefaultSeatIcon()
            }
        })
    }
    getDefaultSeatIcon() {
        return new V.fabric.Circle({
            radius: va * pa / 2
        })
    }
    getSeatAvailListOfArea(e) {
        return this._seatsAvail[e]
    }
    getVenueData(e) {
        return E(this, null, function*() {
            if (!e)
                return Promise.reject("jsonUrl is empty.");
            const t = yield Me(e)
              , a = t.objects[0].width
              , n = t.objects[0].height;
            return t.objects = t.objects.filter(o => o.id !== "background" && o.id !== "backgroundImage").map(o => De(Be({}, o), {
                name: o.id ? $t : ""
            })),
            this.createAreaDataFlow(t.objects.filter(o => !!o.id).map(o => o.id)),
            {
                data: t,
                width: a,
                height: n
            }
        })
    }
    manageSeatCache(e) {
        const t = +"20000";
        let a = 0;
        const n = Object.assign({}, this._seats, this._seatsAvail);
        for (const o in n) {
            const c = n[o];
            c && (a += c.length)
        }
        if (a > t) {
            for (const o in this._seats)
                e.includes(o) || delete this._seats[o];
            for (const o in this._seatsAvail)
                e.includes(o) || delete this._seatsAvail[o]
        }
    }
}
var Ze = {
    exports: {}
};
function Vt(r, e=100, t={}) {
    if (typeof r != "function")
        throw new TypeError(`Expected the first parameter to be a function, got \`${typeof r}\`.`);
    if (e < 0)
        throw new RangeError("`wait` must not be negative.");
    const {immediate: a} = typeof t == "boolean" ? {
        immediate: t
    } : t;
    let n, o, c, d, v;
    function b() {
        const O = n
          , S = o;
        return n = void 0,
        o = void 0,
        v = r.apply(O, S),
        v
    }
    function m() {
        const O = Date.now() - d;
        O < e && O >= 0 ? c = setTimeout(m, e - O) : (c = void 0,
        a || (v = b()))
    }
    const w = function(...O) {
        if (n && this !== n && Object.getPrototypeOf(this) === Object.getPrototypeOf(n))
            throw new Error("Debounced method called with different contexts of the same prototype.");
        n = this,
        o = O,
        d = Date.now();
        const S = a && !c;
        return c || (c = setTimeout(m, e)),
        S && (v = b()),
        v
    };
    return Object.defineProperty(w, "isPending", {
        get() {
            return c !== void 0
        }
    }),
    w.clear = () => {
        c && (clearTimeout(c),
        c = void 0)
    }
    ,
    w.flush = () => {
        c && w.trigger()
    }
    ,
    w.trigger = () => {
        v = b(),
        w.clear()
    }
    ,
    w
}
Ze.exports.debounce = Vt;
Ze.exports = Vt;
var wa = Ze.exports;
const _e = Ar(wa)
  , ma = xr();
let He = 0;
function Sa(r, e) {
    const t = D(!1)
      , a = D([])
      , n = D({
        totalAmount: 0,
        deltaPrice: 0
    })
      , o = D("")
      , c = (v, b, m, w) => {
        a.value = m,
        n.value.totalAmount = v,
        n.value.deltaPrice = b,
        o.value = w
    }
      , d = _e(v => E(this, null, function*() {
        if (e.value) {
            t.value = !0,
            He = ma();
            try {
                const {totalAmount: b, deltaPrice: m, priceList: w, id: O, name: S} = yield _a(v, e.value.id, He);
                He === O && (c(b, m, w, S),
                t.value = !1)
            } catch (b) {
                t.value = !1
            }
        }
    }), 500);
    return he(r, v => {
        if (!e.value)
            return;
        const b = Aa(v, e.value.showFarelevelList);
        c(b.totalAmount, b.deltaPrice, b.priceList, ""),
        e.value.openCalPriceImmediate && d(v)
    }
    ),
    {
        isAsyncCalcing: t,
        detailPriceList: a,
        cheapestPolicy: n,
        suitName: o
    }
}
function _a(r, e, t) {
    return E(this, null, function*() {
        let a = 0
          , n = 0
          , o = []
          , c = "";
        if (r.length > 0) {
            const {data: {totalAmount: d, totalAmountOrigin: v, showSeats: b, name: m}} = yield Et({
                showId: e,
                seatList: r.map(w => ({
                    id: w.id || "",
                    fareLevel: w.fareLevel || ""
                }))
            }, !0);
            n = v - d,
            a = d,
            c = m,
            o = Ft(b.map(w => ({
                price: w.fareLevelPrice,
                id: w.suitCode || ""
            })))
        }
        return {
            totalAmount: a,
            deltaPrice: n,
            priceList: o,
            id: t,
            name: c
        }
    })
}
function Aa(r, e) {
    const t = new Map;
    let a = 0
      , n = [];
    if (r.length > 0) {
        for (const c of e)
            t.set(c.code, c.price);
        const o = [];
        for (const c of r) {
            const d = t.get(c.fareLevel);
            d != null && o.push({
                price: d,
                id: d + ""
            })
        }
        a = o.reduce( (c, d) => (c * 100 + d.price * 100) / 100, 0),
        n = Ft(o)
    }
    return {
        totalAmount: a,
        deltaPrice: 0,
        priceList: n
    }
}
function Ft(r) {
    return r.reduce( (e, t) => {
        const a = t.id || t.price + ""
          , n = e.find(o => o.id === a);
        if (n) {
            const o = n.list.find(c => c.price === t.price);
            n.price += t.price,
            o ? o.num++ : n.list.push({
                num: 1,
                price: t.price
            })
        } else
            e.push({
                price: t.price,
                id: a,
                list: [{
                    num: 1,
                    price: t.price
                }]
            });
        return e
    }
    , [])
}
const xa = {
    class: "flex flex-col h-screen"
}
  , Ta = ["width", "height"]
  , Oa = ["width", "height"]
  , Pa = {
    class: "px-4 pt-2 pb-10"
}
  , La = {
    class: "flex justify-between py-2 text-sm text-gray-400"
}
  , Ea = 58
  , Ba = Tr({
    __name: "PickAreaSeat",
    setup(r) {
        let e = null
          , t = null
          , a = null
          , n = null;
        const o = {
            width: 136,
            height: 136
        }
          , c = +"0.35";
        let d = 0
          , v = 0;
        const b = {
            width: 400,
            height: 400
        }
          , m = +"40"
          , w = +"1"
          , O = +"160"
          , S = new Map
          , F = +"0.6"
          , L = +"0.2"
          , q = "#dde0e5"
          , ie = "#e0e0e0";
        let H = -1
          , re = 56;
        const I = D(0)
          , R = D(0)
          , J = jr()
          , Q = J.query.sid
          , ee = J.query.pid
          , Z = D(!1)
          , Ke = D(!1)
          , Pe = D(!0)
          , Ge = Or()
          , {detailData: T} = Pr(Ge)
          , {getDetail: Ht} = Ge;
        T.value || Ht(ee, Q);
        const k = D([])
          , Le = D(!1)
          , x = D(1)
          , Y = new ga(Q)
          , ae = new Set
          , K = D(null)
          , Yt = J.query.pCode
          , Wt = J.query.ticketOutletId
          , qt = J.query.inV
          , N = D(Yt || "");
        let W = null;
        const et = kr();
        Y.getSeatIconList(),
        V.fabric.Object.prototype.objectCaching = !1;
        const {isAsyncCalcing: Xt, detailPriceList: tt, cheapestPolicy: Ee, suitName: zt} = Sa(k, T)
          , rt = () => Number("0.3" * (w - H))
          , ne = Lr( () => x.value >= rt())
          , Jt = () => ae.size > +"500"
          , Qt = s => {
            if (!t)
                return;
            const l = t == null ? void 0 : t.getObjects();
            for (const i of l)
                i.type === "text" && (i._fill || (i._fill = i.fill),
                s ? i.fill = ie : i.fill = i._fill)
        }
          , Zt = s => {
            let l = 0
              , i = "";
            for (const u of s) {
                const f = S.get(u.k);
                f && f.price > l && (l = f.price,
                i = u.k)
            }
            return i
        }
          , Ie = () => E(this, null, function*() {
            var f;
            const s = yield Y.fetchAreaData();
            if (!t)
                return Promise.reject();
            const l = N.value
              , i = t.getObjects();
            let u = "";
            for (const p of i) {
                if (!p.id || p.id === Pt || p.id === Lt)
                    continue;
                if (!s || !s[p.id] || s[p.id].g === 0) {
                    p.set({
                        fill: ne.value ? "#fff" : q
                    });
                    continue
                }
                const g = s[p.id].e;
                let y = 1;
                l && (g != null && g.some(A => A.k === l)) ? u = l : (l && (y = L),
                u = Zt(g));
                const h = ((f = S.get(u)) == null ? void 0 : f.color) || q;
                ne.value ? p.set({
                    fill: "#fff",
                    opacity: 1,
                    _fill: h
                }) : p.set({
                    fill: h,
                    opacity: y,
                    _fill: h
                })
            }
            t.requestRenderAll()
        })
          , je = () => {
            e != null && e.viewportTransform && (t == null || t.setViewportTransform(e.viewportTransform)),
            t == null || t.requestRenderAll()
        }
          , at = () => {
            if (!t)
                return null;
            const s = t.viewportTransform
              , l = V.fabric.util.findScaleToFit(b, t)
              , i = b.width * l
              , u = b.height * l;
            t.viewportTransform = [l, 0, 0, l, 0, 0];
            let f;
            const p = t.getObjects().filter(h => h.id && h.id !== Pt && h.id !== Lt)
              , g = t.getObjects("text");
            p.forEach(h => {
                f = h.fill,
                h.fill = h._fill,
                h._fill = f,
                h._opacity = h.opacity,
                h.opacity = 1
            }
            ),
            g.forEach(h => {
                f = h.fill,
                h.fill = h._fill,
                h._fill = f
            }
            );
            const y = t.toCanvasElement(1, {
                left: 0,
                top: 0,
                width: i,
                height: u
            });
            return t.viewportTransform = s,
            p.forEach(h => {
                f = h.fill,
                h.fill = h._fill,
                h._fill = f,
                h.opacity = h._opacity
            }
            ),
            g.forEach(h => {
                f = h.fill,
                h.fill = h._fill,
                h._fill = f
            }
            ),
            y
        }
          , Kt = () => {
            if (!a || !e)
                return;
            const s = 1
              , l = at();
            if (!l)
                return;
            const i = V.fabric.util.findScaleToCover(e, o)
              , u = new V.fabric.Image(l);
            u.scaleToWidth(a.width),
            a.backgroundImage = u;
            const f = new V.fabric.Rect({
                top: u.top,
                left: u.left,
                originWidth: I.value * i - s,
                originHeight: R.value * i - s,
                width: I.value * i - s,
                height: R.value * i - s,
                fill: "",
                stroke: "#f40",
                strokeWidth: s
            });
            a.add(f),
            a.requestRenderAll()
        }
          , Gt = _e( () => {
            if (!a || !a.backgroundImage)
                return;
            const s = at();
            s && (a.backgroundImage._element = s,
            a.requestRenderAll())
        }
        , 500)
          , nt = vt( () => {
            if (!e || !a || !a.backgroundImage)
                return;
            const s = a.getObjects()[0]
              , l = V.fabric.util.findScaleToFit(b, e)
              , i = V.fabric.util.findScaleToFit(b, a)
              , u = l / x.value;
            s.width = (s.originWidth || 0) * u,
            s.height = (s.originHeight || 0) * u,
            s.top = (a.backgroundImage.top || 0) - (e.viewportTransform ? e.viewportTransform[5] : 0) * i / x.value,
            s.left = (a.backgroundImage.left || 0) - (e.viewportTransform ? e.viewportTransform[4] : 0) * i / x.value,
            a.requestRenderAll()
        }
        , 500)
          , ot = s => {
            let l = e == null ? void 0 : e.getObjects().filter(i => i.name === Se);
            s && (l = l == null ? void 0 : l.filter(i => typeof s == "string" ? s === `${i.aid}-${i.coordsStr}` : s.some(u => u === `${i.aid}-${i.coordsStr}`))),
            l && l.length > 0 && (e == null || e.remove(...l))
        }
          , st = (s, l, i, u) => E(this, null, function*() {
            const f = yield et(gt);
            f.scaleToWidth(m * F),
            f.set({
                left: s,
                top: l,
                fill: "#000",
                originX: "center",
                originY: "center",
                aid: i,
                coordsStr: u,
                selectable: !1,
                hoverCursor: "default",
                name: Ot
            }),
            e == null || e.add(f)
        })
          , ke = s => {
            let l = e == null ? void 0 : e.getObjects().filter(i => i.name === Ot);
            s && (l = l == null ? void 0 : l.filter(i => typeof s == "string" ? s === `${i.aid}-${i.coordsStr}` : s.some(u => u === `${i.aid}-${i.coordsStr}`))),
            l && l.length > 0 && (e == null || e.remove(...l))
        }
        ;
        function Ce(s) {
            const l = t == null ? void 0 : t.getObjects();
            return !W && l && (W = [],
            l.forEach(i => {
                i.name === $t && (W == null || W.push(De(Be({}, i.getBoundingRect(!0)), {
                    id: i.id || ""
                })))
            }
            )),
            W && s ? W.find(i => i.id === s) : W
        }
        const er = () => E(this, null, function*() {
            var u;
            const {data: s, width: l, height: i} = yield Y.getVenueData(((u = T.value) == null ? void 0 : u.jsonUrl) + "?t=" + Date.now());
            t == null || t.loadFromJSON(s, () => {
                e && or(e, {
                    canvasWidth: l,
                    canvasHeight: i
                }),
                b.width = l,
                b.height = i + Ea,
                je(),
                a && (o.width = Math.min(I.value * c, O),
                o.height = b.height * o.width / l,
                a.setDimensions(o)),
                setTimeout( () => E(this, null, function*() {
                    ft(),
                    yield Ie(),
                    Kt(),
                    nt(),
                    je()
                }), 0)
            }
            ),
            Ke.value = !1
        })
          , it = () => {
            const s = []
              , l = e == null ? void 0 : e.calcViewportBoundaries();
            if (l) {
                const i = Ce();
                i == null || i.forEach(u => {
                    const f = u.top
                      , p = u.left + u.width
                      , g = u.top + u.height
                      , y = u.left;
                    g <= l.tl.y || y >= l.tr.x || f >= l.bl.y || p <= l.bl.x || s.push(u)
                }
                )
            }
            return s
        }
          , lt = (s, l) => {
            const i = []
              , u = e == null ? void 0 : e.calcViewportBoundaries()
              , f = W == null ? void 0 : W.find(y => y.id === s)
              , p = window.innerWidth / 2
              , g = window.innerHeight / 2;
            if (u && f) {
                let y = [];
                const {left: h, top: A} = f;
                if (l)
                    y = l;
                else {
                    let _ = Y.getSeatListOfArea(s);
                    const C = Y.getSeatAvailListOfArea(s);
                    _ && C && (_ = _.filter(j => !C.some(B => B.coordsStr === j.coordsStr))),
                    _ && y.push(..._),
                    C && y.push(...C)
                }
                y.forEach(_ => {
                    const C = _.x !== void 0 ? _.x : h + _.coords[1] * m
                      , j = _.y !== void 0 ? _.y : A + _.coords[0] * m
                      , B = u.tl.x - p
                      , G = u.tr.x + p
                      , P = u.tl.y - g
                      , pe = u.bl.y + g;
                    C > B && C < G && j > P && j < pe && i.push(_)
                }
                )
            }
            return i
        }
          , ct = s => {
            const l = Ce()
              , i = [];
            if (l)
                for (let u = 0, f = l.length; u < f; u++) {
                    const p = l[u];
                    s.x > p.left && s.x < p.left + p.width && s.y > p.top && s.y < p.top + p.height && i.push(p)
                }
            return i
        }
          , tr = s => {
            const l = ct(s);
            if (l.length > 0)
                for (const i of l) {
                    const u = s.x - i.left
                      , f = s.y - i.top
                      , p = Y.getSeatAvailListOfArea(i.id);
                    if (p)
                        for (let g of p) {
                            const y = g.x !== void 0 ? g.x - i.left - m / 2 : g.coords[1] * m
                              , h = g.y !== void 0 ? g.y - i.top - m / 2 : g.coords[0] * m;
                            if (u > y && u <= y + m && f > h && f <= h + m)
                                return g
                        }
                }
            return null
        }
          , rr = (s, l) => E(this, null, function*() {
            const i = lt(s, l)
              , u = Ce(s);
            i.forEach(f => E(this, null, function*() {
                const p = `${f.aid}-${f.coordsStr}`;
                if (ae.has(p)) {
                    const g = (e == null ? void 0 : e.getObjects()) || []
                      , y = g.findIndex(A => A.name === Se && A.aid === f.aid && A.coordsStr === f.coordsStr);
                    let h = y >= 0 ? g[y] : void 0;
                    if (h && f.icon && (!h.icon || h.icon !== f.icon)) {
                        const A = yield Y.getSeatIcon(f.icon);
                        A.scaleToWidth(m * .6),
                        A.set({
                            id: h.id,
                            btype: h.btype,
                            opacity: h.opacity,
                            originX: h.originX,
                            originY: h.originY,
                            angle: h.angle,
                            left: h.left,
                            top: h.top,
                            icon: f.icon,
                            selectable: h.selectable,
                            coordsStr: h.coordsStr,
                            aid: h.aid,
                            name: h.name,
                            fill: h.fill,
                            hoverCursor: h.hoverCursor
                        }),
                        e == null || e.remove(h),
                        h = A,
                        e == null || e.insertAt(h, y, !1)
                    }
                    if (h && !h.id && "id"in f) {
                        const A = !N.value || f.fareLevel === N.value || !f.id;
                        h.set({
                            id: f.id || "",
                            fill: f.color,
                            btype: f.fareLevel,
                            opacity: A ? 1 : L
                        })
                    }
                    h && f.angle && h.set({
                        angle: f.angle
                    })
                } else {
                    ae.add(p);
                    const g = yield Y.getSeatIcon(f.icon);
                    g.scaleToWidth(m * .6);
                    const y = k.value.find(_ => _.aid === f.aid && _.coordsStr === f.coordsStr)
                      , h = ((u == null ? void 0 : u.left) || 0) + f.coords[1] * m + m / 2
                      , A = ((u == null ? void 0 : u.top) || 0) + f.coords[0] * m + m / 2;
                    if (g.set({
                        originX: "center",
                        originY: "center",
                        angle: f.angle,
                        icon: f.icon,
                        left: f.x !== void 0 ? f.x : h,
                        top: f.y !== void 0 ? f.y : A,
                        selectable: !1,
                        coordsStr: f.coordsStr,
                        aid: f.aid,
                        name: Se,
                        fill: q,
                        hoverCursor: "default"
                    }),
                    "id"in f) {
                        const _ = !N.value || f.fareLevel === N.value || !f.id;
                        g.set({
                            id: f.id || "",
                            fill: f.color,
                            btype: f.fareLevel,
                            opacity: _ ? 1 : L
                        })
                    }
                    e == null || e.add(g),
                    y && st(f.x || h, f.y || A, f.aid, f.coordsStr)
                }
                e == null || e.requestRenderAll()
            }))
        })
          , ft = _e( () => E(this, null, function*() {
            if (!ne.value) {
                ke(),
                ot(),
                ae.clear(),
                e == null || e.requestRenderAll();
                return
            }
            const s = it();
            s.length > 0 && (yield Y.getMultiSeatFlow(s.map(i => i.id))).subscribe({
                next: i => {
                    i && i.length > 0 && ne.value && setTimeout( () => {
                        ne.value && rr(i[0].aid, i)
                    }
                    , 100)
                }
            })
        }), 50);
        he(k, (s, l) => E(this, null, function*() {
            if (s.length > l.length) {
                const i = s[s.length - 1]
                  , u = e == null ? void 0 : e.getObjects().find(f => f.id === i.id);
                u && st(u.left || 0, u.top || 0, u.aid, u.coordsStr)
            } else {
                const i = l.find(u => !s.some(f => f.id === u.id));
                if (i) {
                    const u = e == null ? void 0 : e.getObjects().find(f => f.id === i.id);
                    u && ke(`${u.aid}-${u.coordsStr}`)
                }
            }
            e == null || e.requestRenderAll()
        })),
        he(ne, s => {
            Ie(),
            Qt(s)
        }
        );
        const ar = () => E(this, null, function*() {
            var s, l, i, u, f, p, g, y, h, A, _, C, j, B, G;
            if (k.value.length === 0)
                return we("请先选择座位");
            Le.value = !0;
            try {
                const P = {}
                  , {data: pe} = yield Rr({
                    showId: Q,
                    seatList: k.value.map(M => ({
                        id: M.id || "",
                        fareLevel: M.fareLevel || ""
                    }))
                })
                  , {data: ve} = yield Et({
                    showId: Q,
                    seatList: k.value.map(M => ({
                        id: M.id || "",
                        fareLevel: M.fareLevel || ""
                    }))
                });
                P.key = pe.key,
                P.policyName = ve.name,
                P.showSeats = pe.showSeats.map(M => ({
                    salePrice: M.salePrice,
                    snapshot: M.snapshot,
                    fareLevel: M.fareLevel,
                    suitCode: M.suitCode,
                    id: M.id,
                    price: M.fareLevelPrice,
                    fareLevelVerboseName: M.fareLevelVerboseName
                })),
                P.totalAmount = ve.totalAmount, P.deltaPrice = ve.totalAmountOrigin - ve.totalAmount, P.buyProtocolOn = (s = T.value) == null ? void 0 : s.perf_buyProtocolOn, P.buyProtocol = (l = T.value) == null ? void 0 : l.perf_buyProtocol, qt === "1" ? (P.imageUrl = (i = T.value) == null ? void 0 : i.perf_imageUrl, P.name = (u = T.value) == null ? void 0 : u.perf_name, P.venueAddress = (f = T.value) == null ? void 0 : f.perf_venueAddress, P.realNameType = (p = T.value) == null ? void 0 : p.perf_realNameType, P.printTicketTypesMap = (g = T.value) != null && g.perf_printTicketTypesMap ? JSON.parse((y = T.value) == null ? void 0 : y.perf_printTicketTypesMap) : void 0, P.id = (h = T.value) == null ? void 0 : h.perf_id, P.performanceSource = (A = T.value) == null ? void 0 : A.perf_performanceSource, P.showTime = (_ = T.value) == null ? void 0 : _.showTime, P.showName = (C = T.value) == null ? void 0 : C.name, P.showId = (j = T.value) == null ? void 0 : j.id, P.douyinProductId = (B = T.value) == null ? void 0 : B.perf_douyinRelationId, P.ticketOutletId = Wt, P.plugInType = (G = T.value) == null ? void 0 : G.plugInType, console.log(JSON.stringify(P)),
                console.log(`wx.navigateTo({ url: '/pages_game/gameevent/eventpay?seatData=${JSON.stringify(P)}' })`)) : (uni.navigateBack({
                    delta: 1
                }), uni.postMessage({
                    data: {
                        data: P
                }
            }))
                
            } catch (P) {}
            setTimeout( () => {
                Le.value = !1
            }
            , 500)
        })
          , nr = s => E(this, null, function*() {
            k.value = k.value.filter( (l, i) => i !== s)
        })
          , or = (s, {canvasWidth: l=200, canvasHeight: i=200}) => {
            H === -1 && (H = V.fabric.util.findScaleToFit({
                width: l,
                height: i
            }, s)),
            x.value = H,
            s.setViewportTransform([x.value, 0, 0, x.value, (s.width - l * x.value) / 2, (s.height - i * x.value) / 2]),
            s.requestRenderAll()
        }
          , ut = vt(s => {
            const l = s.deltaY;
            x.value *= dt(.999, l),
            x.value > w && (x.value = w),
            x.value < H && (x.value = H),
            le({
                x: s.offsetX,
                y: s.offsetY
            }, x.value)
        }
        , 40)
          , sr = _e( () => {
            if (Jt()) {
                const s = it();
                if (s.length > 0) {
                    const l = [];
                    if (s.forEach(i => {
                        l.push(...lt(i.id))
                    }
                    ),
                    l.length > 0) {
                        const i = [];
                        ae.forEach(u => {
                            l.some(f => u === `${f.aid}-${f.coordsStr}`) || i.push(u)
                        }
                        ),
                        ot(i),
                        i.forEach(u => ae.delete(u)),
                        ke(i),
                        e == null || e.requestRenderAll()
                    }
                }
            }
        }
        , 1e3)
          , le = (f, p, ...g) => E(this, [f, p, ...g], function*({x: s, y: l}, i, u=!1) {
            if (!e)
                return;
            let y = e.viewportTransform;
            i !== void 0 ? (u && (y[4] += v + I.value / 2 - s,
            y[5] += d + R.value / 2 - l,
            e.setViewportTransform(y)),
            yield new Promise(G => {
                setTimeout( () => {
                    e == null || e.zoomToPoint({
                        x: u ? I.value / 2 : s,
                        y: u ? R.value / 2 : l
                    }, i),
                    x.value = i,
                    G(null)
                }
                , 0)
            }
            )) : (y[4] = s,
            y[5] = l),
            y = e.viewportTransform;
            let h = y[4]
              , A = y[5];
            const _ = b.width * x.value
              , C = b.height * x.value
              , j = Math.abs(I.value - _)
              , B = Math.abs(R.value - C);
            _ > I.value ? h > 0 ? y[4] = 0 : Math.abs(h) > j && (y[4] = -j) : h < 0 ? y[4] = 0 : h > j && (y[4] = j),
            C > R.value ? A > 0 ? y[5] = 0 : Math.abs(A) > B && (y[5] = -B) : A < 0 ? y[5] = 0 : A > B && (y[5] = B),
            e.setViewportTransform(y),
            e.requestRenderAll(),
            je(),
            ft(),
            nt()
        })
          , ir = () => {
            if (!K.value)
                return;
            e = new V.fabric.StaticCanvas("design",{
                width: I.value,
                height: R.value,
                selection: !1,
                renderOnAddRemove: !1
            }),
            t = new V.fabric.StaticCanvas("designground",{
                width: I.value,
                height: R.value,
                renderOnAddRemove: !1
            }),
            a = new V.fabric.StaticCanvas("minimap",{
                width: o.width,
                height: o.height,
                renderOnAddRemove: !1
            }),
            ge.on(K.value, "mousewheel", ut),
            n = new ge(K.value),
            n.get("pinch").set({
                enable: !0
            }),
            n.get("pan").set({
                direction: ge.DIRECTION_ALL
            });
            let s = 0
              , l = 0;
            n.on("panstart", function(p) {
                s = p.deltaX,
                l = p.deltaY
            }),
            n.on("panmove", function(p) {
                var g = e == null ? void 0 : e.viewportTransform;
                if (!g || !e)
                    return;
                let y = p.deltaX - s
                  , h = p.deltaY - l
                  , A = g[4] + y
                  , _ = g[5] + h;
                le({
                    x: A,
                    y: _
                }),
                s = p.deltaX,
                l = p.deltaY
            });
            let i = 1
              , u = 1
              , f = 1;
            n.on("pinchstart", function(p) {
                u = p.center.x,
                f = p.center.y,
                i = x.value || 1
            }),
            n.on("pinchmove", function(p) {
                x.value = p.scale * i,
                x.value > w && (x.value = w),
                x.value < H && (x.value = H),
                le({
                    x: u - v,
                    y: f - d
                }, x.value)
            }),
            n.on("panend", () => sr()),
            n.on("tap", function(p) {
                return E(this, null, function*() {
                    var C;
                    const g = fr(p.center.x, p.center.y - d);
                    if (!g || !T.value)
                        return we("座位信息加载中...");
                    const y = ct(g);
                    if (!y.length)
                        return;
                    let h;
                    for (const j of y)
                        if (h = yield Y.fetchAreaData(j.id),
                        h && h.g > 0)
                            break;
                    if (h && h.g === 0)
                        return we("该分区座位已售罄");
                    const A = rt();
                    if (x.value < A) {
                        y.length > 0 && le({
                            x: p.center.x,
                            y: p.center.y
                        }, A, !0);
                        return
                    } else
                        x.value < w && le({
                            x: p.center.x,
                            y: p.center.y
                        }, w, !0);
                    const _ = tr(g);
                    if (_) {
                        const j = k.value.findIndex(B => B.id === _.id);
                        j >= 0 ? k.value = k.value.filter( (B, G) => G !== j) : T.value && (T.value.webPerOrderSellableNumber === 0 || T.value.webPerOrderSellableNumber > k.value.length) ? (k.value = [...k.value, _],
                        N.value && _.fareLevel !== N.value && (N.value = "")) : we(`每个订单限购${(C = T.value) == null ? void 0 : C.webPerOrderSellableNumber}张`)
                    }
                })
            })
        }
          , lr = () => {
            if (K.value) {
                const {height: s} = Br()
                  , {width: l, height: i, top: u, left: f} = K.value.getBoundingClientRect();
                I.value = l,
                R.value = i,
                d = u,
                v = f,
                re = s.value - u - i,
                be(ir),
                be(er)
            }
        }
        ;
        he(T, s => {
            Pe.value = !1,
            s && (s.showFarelevelList && s.showFarelevelList.forEach(l => {
                S.set(l.code, l)
            }
            ),
            document.title = s.showTime.slice(0, -3) + " " + s.name,
            Y.setAreaSeatTempt(s.areaBgJsonUrlTemplet || ""),
            be(lr))
        }
        , {
            immediate: !0
        });
        const cr = s => E(this, null, function*() {
            N.value = N.value === s ? "" : s,
            Ie(),
            be( () => {
                Gt()
            }
            )
        })
          , de = (s, l=!1) => {
            const i = (e == null ? void 0 : e.getObjects().filter(u => u.name === Se && u.id)) || [];
            return s ? i.length > 0 ? i.filter(u => l ? u.btype !== s : u.btype === s) : [] : l ? i : []
        }
        ;
        he(N, (s, l) => {
            let i, u;
            s === "" && l ? i = de(l, !0) : s && l ? (i = de(s),
            u = de(l)) : u = de(s, !0),
            u && u.length > 0 && u.forEach(f => {
                f.set({
                    opacity: L
                })
            }
            ),
            i && i.length > 0 && i.forEach(f => {
                f.set({
                    opacity: 1
                })
            }
            ),
            e == null || e.requestRenderAll()
        }
        );
        const fr = (s, l) => {
            if (!e)
                return;
            const i = e.viewportTransform
              , u = i[4]
              , f = i[5]
              , p = x.value
              , g = (s - u) / p
              , y = (l - f) / p;
            return {
                x: g,
                y
            }
        }
        ;
        return et(gt),
        Er( () => {
            document.title = "选择座位",
            Ke.value = !0
        }
        ),
        Ir( () => {
            K.value && ge.off(K.value, "mousewheel", ut),
            n && n.destroy(),
            e && e.dispose(),
            t && t.dispose(),
            a && a.dispose()
        }
        ),
        (s, l) => {
            const i = Ur
              , u = Dr;
            return te(),
            oe("div", xa, [ce(i, {
                loading: Pe.value,
                row: 3,
                class: "py-3"
            }, {
                default: ye( () => {
                    var f;
                    return [ce($r, {
                        value: N.value,
                        data: (f = $(T)) == null ? void 0 : f.showFarelevelList,
                        onTapItem: cr
                    }, null, 8, ["value", "data"])]
                }
                ),
                _: 1
            }, 8, ["loading"]), U("div", {
                class: "relative flex-1 overflow-hidden",
                style: {
                    "background-color": "#f6f7f8"
                },
                ref_key: "canvasContainerRef",
                ref: K
            }, [U("canvas", {
                class: "absolute top-0 left-0 pointer-events-none",
                id: "designground",
                width: I.value,
                height: R.value
            }, null, 8, Ta), U("canvas", {
                class: "absolute top-0 left-0",
                id: "design",
                width: I.value,
                height: R.value
            }, null, 8, Oa), U("canvas", {
                class: "absolute top-2.5 right-2.5 pointer-events-none rounded-xl",
                style: pt({
                    backgroundColor: "rgba(0, 0, 0, 0.5)",
                    width: o.width + "px",
                    height: o.height + "px"
                }),
                id: "minimap"
            }, null, 4)], 512), ce(i, {
                loading: Pe.value,
                row: 2,
                class: "py-2"
            }, {
                default: ye( () => [$(T) ? (te(),
                Cr(Nr, {
                    key: 0,
                    isAsyncCalcing: $(Xt),
                    "show-price-info": Z.value,
                    paying: Le.value,
                    cheapestPolicy: $(Ee),
                    data: k.value,
                    onToPay: ar,
                    onPopup: l[0] || (l[0] = f => Z.value = !Z.value)
                }, {
                    default: ye( () => {
                        var f;
                        return [ce(Mr, {
                            farelevelList: (f = $(T)) == null ? void 0 : f.showFarelevelList,
                            data: k.value,
                            onDelIndex: nr
                        }, null, 8, ["farelevelList", "data"])]
                    }
                    ),
                    _: 1
                }, 8, ["isAsyncCalcing", "show-price-info", "paying", "cheapestPolicy", "data"])) : yt("", !0)]),
                _: 1
            }, 8, ["loading"]), ce(u, {
                style: pt({
                    marginBottom: $(re) + "px"
                }),
                "overlay-style": {
                    height: `calc(100% - ${$(re)}px)`
                },
                show: Z.value,
                "onUpdate:show": l[1] || (l[1] = f => Z.value = f),
                title: "价格明细",
                teleport: "body"
            }, {
                default: ye( () => [U("div", Pa, [l[3] || (l[3] = U("span", {
                    class: "py-2 text-sm font-bold text-primary"
                }, "票档明细", -1)), (te(!0),
                oe(Ne, null, bt($(tt), f => (te(),
                oe("span", {
                    key: f.price,
                    class: "flex items-center justify-between py-2 text-sm text-gray-400"
                }, [U("span", null, [(te(!0),
                oe(Ne, null, bt(f.list, p => (te(),
                oe("span", {
                    class: "block",
                    key: p.price
                }, se(p.price) + "元*" + se(p.num), 1))), 128))]), U("span", null, se(f.price) + "元", 1)]))), 128)), $(Ee).deltaPrice !== 0 ? (te(),
                oe(Ne, {
                    key: 0
                }, [l[2] || (l[2] = U("span", {
                    class: "py-2 text-sm font-bold text-primary"
                }, "优惠明细", -1)), U("span", La, [U("span", null, se($(zt)) + "*" + se($(tt).length), 1), U("span", null, "-" + se($(Ee).deltaPrice) + "元", 1)])], 64)) : yt("", !0)])]),
                _: 1
            }, 8, ["style", "overlay-style", "show"])])
        }
    }
});
export {Ba as default};
